<!DOCTYPE html>
<html lang="en">

<head>
    <{include file="header.html" }>
        <title>直播课-课程管理-
            <{$user_data[ 'school_name']}>-德安信会计在线教育平台</title>
</head>

<body>
    <div class="wrap">
        <!--star left-->
        <div class="column">
            <{include file="left_menu.html" }>
        </div>
        <div id="ContMianBox">
            <!--star子栏目-->
            <div class="sub-colum">
                <div class="tit">课程管理</div>
                <ul>
                    <{if $is_manage == 1}><li><a href="/course">视频课</a></li><{/if}>
                    <li class="curr"><a href="/course_zhibo">直播课</a></li>
                    <li><a href="/course_banke">面授课</a></li>
                </ul>
            </div>
            <!--end子栏目-->
            <!--end left-->
            <div class="container narrow">
                <!--star conter-->
                <div class="cetContent">
                    <div class="tit p-lr20">
                        <span class="curr">直播课</span>
                        <{if $is_manage == 1}><span><a href="/course_zhibo/cate_subject_list">直播课科目</a></span><{/if}>
                        <{if $is_manage == 1}><span><a href="/course_zhibo/cate_list">直播课分类</a></span><{/if}>
                    </div>
                </div>
                <!--star内容区域-->
                <div class="mainScroll">
                    <div class="mainContainer line-all">
                        <!--star tabMainCont-->
                        <div class="tabMainCont">
                            <!--star-->
                            
                            <!--end-->
                             <fieldset class="layui-elem-field">
                                <legend>按条件搜索</legend>
                                <div class="layui-field-box">
                                    <form class="layui-form layui-form-pane1" method="post" action="<{$current_url}>">
                                        <{assign var="pid" value=$conditions['pid']|default:"all"}>
                                        
                                            <div class="layui-input-inline">
                                                <select name="category[cate_id]" class="abc" lay-verify="required" id="cate_id" placeholder="请选择" lay-filter="cate_id">
                                                    <option value="">课程分类</option>
                                                    <{foreach from=$cate item=item}>
                                                        <option value="<{$item.id}>" <{if $data['cate_id']|default:"" eq $item.id}>selected="selected"<{/if}>><{$item.name}></option>
                                                    <{/foreach}>
                                                </select>
                                            </div>
                                            <div class="layui-inline">
                                                <select name="category[kemu]" lay-verify="required" id="subject" placeholder="请选择" lay-filter="subject">
                                                    <option value="">请选择科目</option>
                                                     <{foreach from=$subject item=item}>
                                                        <option value="<{$item.id}>" <{if $data['kemu']|default:"" eq $item.id}>selected="selected"<{/if}>><{$item.name}></option>
                                                    <{/foreach}>
                                                </select>
                                            </div>

                                            <div class="layui-inline">
                                                <input type="text" name="category[search]" placeholder="搜索内容" value="<{if $data['search']}><{$data['search']}><{/if}>" class="layui-input">
                                            </div>

                                            <div class="layui-inline">
                                                <button type="submit" class="layui-btn">搜索</button>
                                                <{if $is_manage == 1}><a class="layui-btn" href="/course_zhibo/publish"><i class="layui-icon"></i> 发布直播课</a><{/if}>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </fieldset>
                            <!--商品列表 star-->
                            <div class="goods_list p-t10">
                                <div class="mtc_tab">
                                    <!--star mt-->
                                    <div class="mt">
                                        <span class="l fs16">状态：</span>
                                        <a href="/course_zhibo" <{if $data.status==10 }>class='curr'<{/if}>>全部</a>
                                        <a href="/course_zhibo/index/1/<{$data.sort}>/<{$data.asc_des}>/<{$data.search}>/<{$data.cate_id}>/<{$data.kemu}>/<{$data.limit}>" <{if $data.status==1 }>class="curr"<{/if}>>即将直播</a>
                                        <a href="/course_zhibo/index/0/<{$data.sort}>/<{$data.asc_des}>/<{$data.search}>/<{$data.cate_id}>/<{$data.kemu}>/<{$data.limit}>" <{if $data.status==0 }>class="curr"<{/if}>>已直播</a>
                                
                                    </div>
                                    <!--end mt-->
                                    <!--star mc-->
                                    <div class="mc">

                                        <div class="u_table_list m-t20">
                                            <!--star 商品-->
                                            <div class="table002">
                                                <table>
                                                    <colgroup>
                                                        <!-- <col width="4%"> -->
                                                        <col width="%">
                                                        <col width="%">
                                                        <col width="%">
                                                        <col width="%">
                                                        <col width="%">
                                                        <col width="%">
                                                        <col width="%">
                                                    </colgroup>
                                                    <tbody>
                                                        <tr>
                                                            <!-- <th><input type="checkbox"></th> -->
                                                            <th>课程</th>
                                                            <th>价格</th>
                                                            <th>报名人数</th>
                                                            <th>直播时间</th>
                                                            <th>发布时间</th>
                                                            <th>状态</th>
                                                            <th></th>
                                                        </tr>
                                                    </tbody>
                                                    <tbody>
                                                        <{foreach from=$zhiboke item=item}>
                                                            <tr>
                                                                <!-- <td class="not_lb tal"><input type="checkbox"></td> -->
                                                                <td class="not_lb tal">
                                                                    <div class="product_name">
                                                                        <div class="t_img"><img src="<{$item.course_img}>" /></div>
                                                                        <div class="t_info">
                                                                            <a class="fs20" target="_blank" href="<{$school_info.url_web}>/live/detail/<{$item.id}>">
                                                                                <{$item.title}>
                                                                            </a>
                                                                            <div>时长：
                                                                                <{$item.course_time}>分钟</div>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                                <td class="not_lb tal"><span class="c-ff6d5e">¥<{$item.price}>元</span></td>
                                                                <td class="not_lb tal"><{$item['sale_count']}></td>
                                                                <td class="not_lb tal"> 
                                                                开始：<{$item[ 'start_time']|date_format: '%Y-%m-%d %H:%M:%S'}><br />
                                                                    结束：<{$item[ 'end_time']|date_format: '%Y-%m-%d %H:%M:%S'}>
                                                                </td>
                                                                <td class="not_lb tal">
                                                                    <{$item[ 'add_time']|date_format: '%Y-%m-%d %H:%M:%S'}></td>
                                                                <td class="not_lb tal">
                                                                    <div class="colorBtn">
                                                                        <{if $item['live_status']==1}>
                                                                        未开始
                                                                        <{elseif $item['live_status']==2}>
                                                                        直播中
                                                                        <{else}>
                                                                        已结束
                                                                        <{/if}>
                                                                    </div>
                                                                </td>
                                                                <td class="not_lb tal">
                                                                    <div class="colorBtn">
                                                                     <{if $item['live_status']==1}>
                                                                        
                                                                        <{/if}>
                                                                        <p><a href="/course_zhibo/edit/<{$item.id}>">编辑</a>
                                                                        <a onclick="javascript:return confirm('确定要删除该课程吗？');" href="/course_zhibo/delete/<{$item.id}>">删除</a>
                                                                        </p>
                                                                        <p><a onclick="javascript:;" href="/course/comment_list/<{$item['id']}>">查看评论</a></p>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                            <{/foreach}>
                                                    </tbody>
                                                </table>
                                            </div>
                                            <!--end 商品-->
                                        </div>
                                        <div class="pages p-tb20" style="text-align:right;">
                                            <!-- <div class="l">
                                    <a href="javascript:;" class="zent-btn">未知按钮</a>
                                    <a href="javascript:;" class="zent-btn">未知按钮</a>
                                    <a href="javascript:;" class="zent-btn">未知按钮</a>
                                    <a href="javascript:;" class="zent-btn">未知按钮</a>
                                </div> -->
                                            <div class="pages p-tb20">
                                                <{$pagination}>
                                            </div>
                                        </div>
                                    </div>
                                    <!--end mc-->
                                </div>

                            </div>
                            <!--商品列表 end -->
                        </div>
                        <!--end tabMainCont-->
                    </div>

                </div>
            </div>
            <!--end内容区域-->
            <{include file="footer.html"}>
            <script>
                layui.use(['form','layedit','jquery'], function() {
                    var form = layui.form();
                    $ = layui.jquery;

                    //监听提交
                    form.on('submit(formDemo)', function(data) {
                        layer.msg(JSON.stringify(data.field));
                        return false;
                    });
                    form.on('select(cate_id)', function(data){
                        var ii = layer.load();
                        var id = data.value;
                        $("#course_id").html('<option value="">请选择科目</option>');
                        form.render('select');
                        $.ajax({
                            type: "POST",
                            url: "/course/get_cate_subject",
                            data: {id:id},
                            dataType: "json",
                            success: function (data) {
                                var ddl = $("#subject");
                                var html ='<option value="">请选择科目</option>';
                                $(data).each(function (key) {
                                    html += "<option value='"+data[key].id+"'>"+data[key].name+"</option>";
                                });
                                $("#subject").html(html);
                                form.render('select');
                                layer.close(ii);
                            }
                        });
                    });  
                });
            </script>